<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:calli="http://callimachusproject.org/rdf/2009/framework#">
<head>
    <title resource="?this">{rdfs:label}</title>
    <link rel="help" href="../../callimachus-for-web-developers#PURL" target="_blank" title="Help" />
    <style>
        form#form textarea {
            white-space: pre;
            word-wrap: normal;
        }
    </style>
    <script type="text/javascript">
    // <![CDATA[
    jQuery(function($){
        $('textarea.pattern.hide').remove();
        $('textarea.pattern[property]').each(function(){
            $('#type').val(this.getAttribute('property'));
        });
        $('#type').change(function(){
            $('textarea.pattern').attr('data-text-expression', this.value);
            $('textarea.pattern').attr('property', this.value);
        }).change();
        $('#form').bind('calliRedirect', function(event){
            if (event.resource == event.location) {
                event.location = event.resource + '?view';
            }
        });
    });
    // ]]>
    </script>
</head>
<body resource="?this">
    <h1 property="rdfs:label" />
    <form role="form" id="form" method="POST" action="" enctype="application/sparql-update" resource="?this">
        <fieldset class="row">
            <div class="form-group col-md-6">
                <label for="comment">Comment</label>
                <div class="controls">
                    <textarea id="comment" class="auto-expand col-md-6">{rdfs:comment}</textarea>
                </div>
            </div>
        </fieldset>
        <div class="row">
            <fieldset class="col-md-3">
                <div class="form-group">
                    <label for="type">GET status</label>
                    <div class="controls">
                        <select id="type" class="col-md-3">
                            <option value="calli:copy">Copy (200)</option>
                            <option value="calli:canonical">Canonical (301)</option>
                            <option value="calli:alternate" selected="selected">Alternate (302)</option>
                            <option value="calli:describedby">Described by (303)</option>
                            <option value="calli:resides">Resides (307)</option>
                            <option value="calli:moved">Moved (308)</option>
                            <option value="calli:missing">Missing (404)</option>
                            <option value="calli:gone">Gone (410)</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label for="pattern">GET content location</label>
                    <div class="controls">
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:copy"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:canonical"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:alternate"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:describedby"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:resides"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:moved"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:missing"></textarea>
                        <textarea class="pattern col-md-3 auto-expand" rows="1" property="calli:gone"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="cache">GET cache control</label>
                    <div class="controls">
                		<input type="text" id="cache" value="{calli:cacheControl}" placeholder="max-age=3600" class="form-control col-md-3" />
                    </div>
                </div>
            </fieldset>
            <fieldset class="col-md-3">
                <div class="form-group">
                    <label for="post">POST request target</label>
                    <div class="controls">
                        <textarea id="post" class="col-md-3 auto-expand" rows="1">{calli:post}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="put">PUT request target</label>
                    <div class="controls">
                        <textarea id="put" class="col-md-3 auto-expand" rows="1">{calli:put}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="patch">PATCH request target</label>
                    <div class="controls">
                        <textarea id="patch" class="col-md-3 auto-expand" rows="1">{calli:patch}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label for="delete">DELETE request target</label>
                    <div class="controls">
                        <textarea id="delete" class="col-md-3 auto-expand" rows="1">{calli:delete}</textarea>
                    </div>
                </div>
            </fieldset>
        </div>
        <fieldset class="row">
            <div class="form-group col-md-6">
                <button type="submit" class="btn btn-primary">Save</button>
                <button type="button" onclick="window.location.replace('?view')" class="btn btn-default">Cancel</button>
                <button type="button" onclick="calli.deleteResource(event)" class="btn btn-danger">Delete</button>
            </div>
        </fieldset>
    </form>
</body>
</html>
